<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>学生信息列表</title>
</head>
<body>

<h1>学生信息列表</h1>
<a href="/add.jsp"><button>添加</button></a>
<table border="1px" cellspacing="0" width="100%">
    <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>操作</th>
    </tr>
<c:forEach items="${students}" var="student">
    <tr>
        <td>${student.id}</td>
        <td>${student.name}</td>
        <td>${student.age}</td>
        <td>
            <a href="/student?method=toUpdate&id=${student.id}">编辑</a>
            <a href="/student?method=delete&id=${student.id}">删除</a>
        </td>
    </tr>
</c:forEach>

</table>

<span style="color: red">${msg}</span>
<c:remove var="msg" scope="session"></c:remove>


</body>
</html>
